export const schema = {
    type: "page",
    title: "商户管理",
    body: {
        type: "crud",
        api: "get:/api/auth/team",
        columnsTogglable: true,
        showHeader: false,
        columns: [
            {
                name: "id",
                label: "团队ID"
            },

            {
                name: "org_id",
                label: "所属机构",
                type: "tpl",
                tpl: `<% if (data.acl.can("org:view")) { %>
                    <a data-link='/org/view/<%= data.org.id %>'><%= data.org.name %></a>
                    <% } else { %>
                        <span><%= data.org.name %></span>
                        <% } %>`
            },

            {
                name: "name",
                label: "团队名称",
            },


            // {
            //     name: 'content',
            //     label: '跳转方式',
            //     type: "tpl",
            //     tpl: "${content}"
            // },

            {
                name: "goods_num",
                label: "商品数",
            },


            {
                name: "orders_num",
                label: "订单数",
            },


            {
                name: "orders_points",
                label: "消耗积分",
            },

            {
                label: "操作",
                type: "operation",
                width: 180,
                buttons: [
                    {
                        type: "button",
                        size: "xs",
                        level: "info",
                        label: "权限管理",
                        actionType: "link",
                        link: "/team/acl/${id}"
                    },
                ]
            }
        ]
    }
};
